<!--登记收账-->
<!DOCTYPE html SYSTEM "http://www.thymeleaf.org/dtd/xhtml1-strict-thymeleaf-spring4-4.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
      xmlns:th="http://www.thymeleaf.org">
<head>
    <title>首页</title>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
</head>
<body>
<div    id="content">
    <section class="content-header">
        <h1>
            <i class="fa fa-dashboard"></i>
            <strong>应收账管理</strong>
        </h1>
        <ol class="breadcrumb">
            <li><a href="#"><i class="fa fa-home "></i>Home</a></li>
            <li>收账/开票登记</li>
            <li class="active">登记收账</li>
        </ol>
    </section>
    <!-- Main content -->
    <section class="content">
        <div class="row">
            <div class="col-md-12">
                <div class="box box-info">
                    <div class="widget-content nopadding">
                        <form id="paidForm">
                        <table class="table table-bordered">
                            <tbody>
                            <tr>
                                <td width="8%" align="center">合同编号</td>
                                <td width="16%">
                                    <div class="col-md-11">
                                        <input class="form-control" type="text"  readonly="readonly" name="code" th:value="${contract.supplierCode}"/>
                                        <input class="form-control" type="hidden" id="contractId" name="contractId" th:value="${contract.Id}"/>
                                        <input class="form-control" type="hidden" id="contractType" name="contractId" th:value="${contract.contractType}"/>
                                        <input class="form-control" type="hidden" id="userId" name="userId" th:value="${userId}"/>
                                        <input class="form-control" type="hidden" id="superior" name="superior" th:value="${user.saleArea.superior}"/>
                                        <input class="form-control" type="hidden" id="sumScheduleSum" name="sumScheduleSum" th:value="${sumScheduleSum}"/>
                                        <input class="form-control" type="hidden" id="divideScales" name="divideScales" th:value="${divideScales}"/>
                                    </div>
                                </td>
                                <td width="8%" align="center">公司名称</td>
                                <td width="16%">
                                    <div class="col-md-12">
                                        <input class="form-control" type="text" readonly="readonly" name="compName" th:value="${contract.orderUnit}"/>
                                    </div>
                                </td>

                                <td width="8%" align="center">合同总额(元)</td>
                                <td width="16%">
                                    <div class="col-md-11">
                                        <input class="form-control" type="text"  readonly="readonly" name="paySum" th:value="${#numbers.formatDecimal(contract.totalSum,1,2)}"/>
                                    </div>
                                </td>
                            </tr>
                            <tr>
                                <td width="8%" align="center">负责人</td>
                                <td width="16%">
                                    <div class="col-md-11">
                                        <input class="form-control" type="text" readonly="readonly" name="receiver" th:value="${contract.dutyOfficer}"/>
                                    </div>
                                </td>
                                <td width="8%" align="center">签订时间</td>
                                <td width="16%">
                                    <div class="col-md-12">
                                        <input class="form-control" type="text"
                                               readonly="readonly" id="signedDate1"
                                               disabled="disabled"/>
                                        <input class="hide" type="text"
                                               readonly="readonly" id="signedDate"
                                               disabled="disabled"
                                               th:value="${contract.signedDate}"/>
                                    </div>
                                </td>
                                <td width="8%" align="center">交货时间</td>
                                <td width="16%">
                                    <div class="col-md-11">
                                        <input class="form-control" type="text"
                                               id="giveOutDate1" readonly="readonly"
                                               disabled="disabled"/>
                                        <input class="hide" type="text"
                                               id="giveOutDate" readonly="readonly"
                                               disabled="disabled"
                                               th:value="${contract.giveOutDate}"/>
                                    </div>
                                </td>
                            </tr>
                            <tr>
                                <td width="8%" align="center">项目名称</td>
                                <td colspan="3">
                                    <div class="col-md-12">
                                        <input class="form-control" type="text"  readonly="readonly" name="name" th:value="${contract.projectName}"/>
                                    </div>
                                </td>
                                <td width="8%" align="center">片区/行业</td>
                                <td width="16%">
                                    <div class="col-md-11">
                                        <input class="form-control" type="text" readonly="readonly" name="arae" th:value="${contract.orderArea}"/>
                                    </div>
                                </td>
                            </tr>
                            <tr>
                                <td width="8%" align="center">备注</td>
                                <td colspan="3">
                                    <div class="col-md-12">
                                        <textarea class="form-control" style="width:100%" row="2" readonly="readonly" th:text="${contract.memo}"></textarea>
                                    </div>
                                </td>
                            </tr>
                                <tr>
                                    <td width="8%" align="center">付款方式</td>
                                    <td colspan="3">
                                        <div class="col-md-12">
                                            <textarea class="form-control" style="width:100%" name="payWay" id="payWay" th:text="${contract.payType}" readonly="readonly"></textarea>
                                        </div>
                                    </td>
                                </tr>
                                <tr>
                                    <td width="8%" align="center" style="vertical-align:middle">总回款凭据</td>
                                    
                                    <td width="16%">
                                    <div class="col-md-8">
											<input type="hidden" id="sReceivedPaymentTotalId" /> 
											<input type="text" class="form-control"
												id="sReceivedPaymentTotalId-identify" readonly="readonly" datatype="*" nullmsg="必须选择总回款凭据"/>
										</div>
										<div class="col-md-2">
											<!-- <button type="button" id="getsReceivedPaymentTotalId" class="btn btn-info" title="引入回款凭据信息"> <i class="fa fa-search"></i> </button> -->
                                        	<button type="button" id="getsReceivedPaymentTotalId" class="btn btn-info">选择</button>
										</div>
										<div class="col-md-1">
											<button type="button" id="clearsReceivedPaymentTotalId" class="btn btn-info">清除</button>
										</div>
                                    </td>
                                    <td width="8%" align="center" style="vertical-align:middle">回款金额(元)</td>
                                    <td width="16%">
                                        <div class="col-md-10">
                                                <input class="form-control" type="text" name="nReceivedPaymentActualPrice" id="nReceivedPaymentActualPrice" datatype="*,*1-11,t" nullmsg="请输入回款金额" onkeyup="clearNoNum(this)"/>
                                        </div>
                                        <div class="col-md-1">
                                            <span style="color:#F00">*</span>
                                        </div>
                                        <div class="col-md-1">
                                        	<button type="button" class="btn btn-info pull-right changeBtn">选择</button>
                                        </div>
                                    </td>
                                    <td width="8%" align="center">回款人</td>
                                    <td width="16%">
                                        <div class="col-md-10">
                                            <select class="form-control" type="text"  name="sReceivedPaymentPersonId" id="sReceivedPaymentPersonId" datatype="*,*1-100,t" nullmsg="请输入回票人">
                                                <option></option>
                                                <option th:each="user:${users}"
                                                        th:text="${user.empLogin.name}"
                                                        th:value="${user.empLogin.empId}"
                                                        >
                                                </option>
                                            </select>
                                        </div>
                                        <div class="col-md-1">
                                            <span style="color:#F00">*</span>
                                        </div>
                                   </td>
                                    <!-- <td width="16%">
                                        <div class="col-md-10">
                                            <select class="form-control" type="text" name="sReceivedPaymentPersonId" id="sReceivedPaymentPersonId" datatype="*,*1-100,t" nullmsg="请输入回款人" >
                                                <option></option>
                                                <option th:each="user:${users}"
                                                        th:text="${user.empLogin.name}"
                                                        th:value="${user.empLogin.empId}">
                                                </option>
                                            </select>
                                        </div>
                                        <div class="col-md-1">
                                            <span style="color:#F00">*</span>
                                        </div>
                                    </td> -->
                                    

                                </tr>
                                <tr>
                                    <td width="8%" align="center">回款计划时间</td>
                                    <td width="16%">
                                        <div class="col-md-10">
                                            <input class="form-control" type="date" name="dReceivedPaymentPlanAccDate" id="dReceivedPaymentPlanAccDate" datatype="*" nullmsg="请输入回款时间"/>
                                        </div>
                                        <div class="col-md-1">
                                            <span style="color:#F00">*</span>
                                        </div>
                                    </td>
                                    <td width="8%" align="center" id="accHandler">回款生效时间</td>
                                    <td width="16%" id="accHandlerDate">
                                        <div class="col-md-10">
                                            <input class="form-control" type="date" name="dReceivedPaymentActualAccDate" id="dReceivedPaymentActualAccDate" datatype="*" nullmsg="请输入回款时间"/>
                                        </div>
                                        <div class="col-md-1">
                                            <span style="color:#F00">*</span>
                                        </div>
                                    </td>
                                    <td width="8%" align="center">回款方式</td>
                                    <td width="16%">
                                        <div class="col-md-10">
                                            <select class="form-control" type="text"  name="sReceivedPaymentTradeWay" id="sReceivedPaymentTradeWay" datatype="*,*1-100,t" nullmsg="请输入回款方式" >
                                                <option th:each="state:${states}"
                                                        th:text="${state.title}"
                                                        th:value="${state.id}">
                                                </option>
                                            </select>
                                        </div>
                                        <div class="col-md-1">
                                            <span style="color:#F00">*</span>
                                        </div>
                                    </td>                                                                       
                                </tr>
                                <tr>
                                    <td width="8%" align="center">备注</td>
                                    <td colspan="3">
                                    <div class="col-md-12">
                                        <textarea class="form-control" style="width:100%" name="sReceivedPaymentMemo" id="sReceivedPaymentMemo" row="2"></textarea>
                                    </div>
                                    </td>
                                    <td width="8%" align="center" id = "handlerText">经办人</td>
                                    <td width="16%" id="handlerContent">
                                        <div class="col-md-10">
                                            <!-- <select class="form-control" type="text"  name="sCreateUserId" id="sCreateUserId" datatype="*,*1-100,t" nullmsg="请输入回款人" >
                                                <option></option>
                                                <option th:each="user:${users}"
                                                        th:text="${user.empLogin.name}"
                                                        th:value="${user.empLogin.empId}"
                                                        >
                                                </option>
                                            </select> -->
                                            <!-- <input class="form-control" type="text" name="sCreateUserId-text" id="sCreateUserId-text" th:text="${currentUserName}"/> -->
                                            <input class="form-control" type="text" name="sCreateUserId-text" id="sCreateUserId-text" th:value="${user.empLogin.name}" readonly="readonly"/>
                                        </div>
                                    </td> 
                                 </tr>
                            </tbody>
                        </table>
                        </form>
                    </div>
                            <!-- Custom Tabs -->
                            <div class="nav-tabs-custom">
                                <ul class="nav nav-tabs" id="myTabs">
                                    <li class="payHistory" id="tab1"><a href="#tab_" data-toggle="tab">占比划分</a></li>
                                    <li><a href="#tab_1" data-toggle="tab">回款计划</a></li>
                                    <li><a href="#tab_2" class="active" data-toggle="tab">回款历史</a></li>
                                    <li><a href="#tab_3" class="showOldPayment" data-toggle="tab">开票历史</a></li>
                                    <li><a href="#tab_4" class="showPaid" data-toggle="tab">回款-计划</a></li>
                                    <li><a href="#tab_5" class="showPayment" data-toggle="tab">开票-计划</a></li>
                                    <button type="button" class="btn btn-info pull-right deletePayBtn">删除回款</button>
                                    <button type="button" class="btn btn-info pull-right editPayBtn">编辑回款</button>
                                    <button type="button" class="btn btn-info pull-right deletePaymentBtn">删除开票</button>
                                    <button type="button" class="btn btn-info pull-right editPaymentBtn">编辑开票</button>
                                </ul>
                                <div class="tab-content">
                                    <div class="tab-pane " id="tab_">
                                        <table id="resultScaleTable" class="mytable dataTable table-bordered text-center table-striped table-hover" cellspacing="0" width="100%">
                                            <thead>
                                            <tr>
												<th width="6%" >序号</th>
												<th width="15%" >负责人</th>
												<th width="15%" >所属片区</th>
												<th width="20%" >占比划分(元)</th>
												<th width="15%" >百分比</th>
												<th width="24%" >备注</th>
											</tr>
                                            </thead>
                                            <tbody>
                                            </tbody>
                                        </table>
                                    </div>
                                    <div class="tab-pane " id="tab_1">
                                        <table id="scheduleTable" class="mytable dataTable table-bordered text-center table-striped table-hover" cellspacing="0" width="100%">
                                            <thead>
                                            <tr>
                                                <th width="20%" >序号</th>
                                                <th width="20%" >款项</th>
                                                <th width="20%" >金额(元)</th>
                                                <th width="20%" >计划收款时间</th>
                                                <th width="20%" >备注</th>
                                            </tr>
                                            </thead>
                                            <tbody>
                                            </tbody>
                                        </table>
                                    </div>
                                    <div class="tab-pane active" id="tab_2">
                                        <table id="payTable" class="mytable dataTable table-bordered text-center table-striped table-hover" cellspacing="0" width="100%" type="2">
                                            <thead>
                                            <tr>
                                                <th width="5%">序号</th>
                                                <th width="5%">操作</th>
                                                <th width="10%">回款金额(元)</th>
                                                <th width="20%">回款方式</th>
                                                <th width="20%">回款时间</th>
                                                <th width="10%">回款人</th>
                                                <th width="10%">经办人</th>
                                                <th width="10%">是否考核</th>
                                                <th width="10%">备注</th>
                                            </tr>
                                            </thead>
                                            <tbody>
                                            </tbody>
                                        </table>
                                        <table class="table table-bordered">
                                            <tbody>
                                            <tr>
                                                <td width="8%" class="center">合同总金额</td>
                                                <td width="16%">
                                                    <div class="col-md-11">
                                                        <div class="input-group">
                                                        <input class="form-control" type="text" name="paidSum1" id="paySum1" th:value="${#numbers.formatDecimal(contract.totalSum,1,2)}" readonly="readonly"/>
                                                            <span  class="input-group-addon">元</span>
                                                        </div>
                                                        </div>
                                                </td>
                                                <td width="8%" class="center">回款总金额</td>
                                                <td width="16%">
                                                    <div class="col-md-11">
                                                        <div class="input-group">
                                                        <input class="form-control" type="text" name="paySum" id="paySum" readonly="readonly" th:value="${#numbers.formatDecimal(paidSum,1,2)}"/>
                                                            <span  class="input-group-addon">元</span>
                                                        </div>
                                                        </div>
                                                </td>
                                                <td width="8%" class="center">剩余金额</td>
                                                <td width="16%">
                                                    <div class="col-md-11">
                                                        <div class="input-group">
                                                        <input class="form-control" type="text" name="paidRemain" id="paidRemain" readonly="readonly" th:value="${#numbers.formatDecimal(contract.totalSum-paidSum,1,2)}"/>
                                                            <span  class="input-group-addon">元</span>
                                                        </div>
                                                        </div>
                                                </td>
                                            </tr>
                                            </tbody>
                                        </table>
                                    </div>
                                    <div class="tab-pane" id="tab_3">
                                        <table id="paymentTable" class="mytable dataTable table-bordered text-center table-striped table-hover" cellspacing="0" width="100%" type="3">
                                            <thead>
                                            <tr>
                                                <th width="10%">序号</th>
                                                <th width="10%">操作</th>
                                                <th width="20%">开票金额(元)</th>
                                                <th width="20%">开票时间</th>
                                                <th width="20%">开票人</th>
                                                <th width="20%">备注</th>
                                            </tr>
                                            </thead>
                                            <tbody>
                                            </tbody>
                                        </table>
                                        <table class="table table-bordered">
                                            <tbody>
                                            <tr>
                                                <td width="8%" class="center">合同总金额</td>
                                                <td width="16%">
                                                    <div class="col-md-11">
                                                        <div class="input-group">
                                                        <input class="form-control" type="text" name="paidSum2" id="paySum2" th:value="${#numbers.formatDecimal(contract.totalSum,1,2)}" readonly="readonly"/>
                                                            <span  class="input-group-addon">元</span>
                                                        </div>
                                                        </div>
                                                </td>
                                                <td width="8%" class="center">开票总金额</td>
                                                <td width="16%">
                                                    <div class="col-md-11">
                                                        <div class="input-group">
                                                        <input class="form-control" type="text" name="payment" id="payment" readonly="readonly" th:value="${#numbers.formatDecimal(paymentSum,1,2)}"/>
                                                        <span  class="input-group-addon">元</span>
                                                        </div>
                                                        </div>
                                                </td>
                                                <td width="8%" class="center">剩余金额</td>
                                                <td width="16%">
                                                    <div class="col-md-11">
                                                        <div class="input-group">
                                                        <input class="form-control" type="text" name="remain" id="remain" readonly="readonly" th:value="${#numbers.formatDecimal(contract.totalSum-paymentSum,1,2)}" />
                                                        <span  class="input-group-addon">元</span>
                                                    </div>
                                                        </div>
                                                </td>
                                            </tr>
                                            </tbody>
                                        </table>
                                    </div>
                                    <div class="tab-pane" id="tab_4">
                                        <table id="paidScheduleTable" class="mytable dataTable table-bordered text-center table-striped table-hover" cellspacing="0" width="100%">
                                            <thead>
                                            <tr>
                                                <th width="10%" >序号</th>
                                                <th width="10%" >款项</th>
                                                <th width="15%" >回款计划金额(元)</th>
                                                <th width="15%" >回款金额进度(元)</th>
                                                <th width="20%" >计划收款时间</th>
                                                <th width="15%" >回款时间偏差(天)</th>
                                                <th width="15%" >备注</th>
                                            </tr>
                                            </thead>
                                            <tbody>
                                            </tbody>
                                        </table>
                                    </div>
                                    <div class="tab-pane" id="tab_5">
                                        <table id="paymentScheduleTable" class="mytable dataTable table-bordered text-center table-striped table-hover" cellspacing="0" width="100%">
                                            <thead>
                                            <tr>
                                                <th width="20%" >序号</th>
                                                <th width="20%" >款项</th>
                                                <th width="20%" >开票金额进度(元)</th>
                                                <th width="20%" >计划收款时间</th>
                                                <th width="20%" >备注</th>
                                            </tr>
                                            </thead>
                                            <tbody>
                                            </tbody>
                                        </table>
                                    </div>
                                </div><!-- /.tab-content -->
                            </div><!-- nav-tabs-custom -->
                    <a type="button" class="btn btn-default pull-right" href="javascript:history.go(-1)">返回</a>
                    <button type="button" class="btn btn-primary pull-right savePayBtn">保存</button>
                </div>
             </div>
            </div>
    </section>
    <div class="modal" id="changeEditModal">
    	<div class="modal-dialog" role="dialog">
            <form id="changeEditForm">
                <div class="modal-content">
                    <div class="modal-header">
                        <button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">&times;</span></button>
                        <h4 class="modal-title"><strong>金额计算</strong></h4>
                    </div>
                    <div class="modal-body">
                        <div class="form-horizontal">
                            <div class="form-group">
                                <label class="col-md-2 control-label">回款金额(元)</label>
                                <div class="col-md-4">
                                    <div class="col-md-10">
                                            <input class="form-control" type="text" name="money1" id="money1" datatype="*,*1-11,t" nullmsg="请输入金额" onkeyup="clearNoNum(this)"/>
                                    </div>
                                    <div class="col-md-1">
                                        <span style="color:#F00">*</span>
                                    </div>
                                </div>
                                <label class="col-md-2 control-label">所占百分比</label>
                                <div class="col-md-4">
                                    <div class="col-md-10">
                                    	<input class="form-control" type="text" name="bfb" id="bfb" datatype="*,*1-11,t" nullmsg="请输入百分比" onkeyup="clearNoNum(this)"/>
                                    </div>
                                    <div class="col-md-1">
                                        <span style="color:#F00">*</span>
                                    </div>
                                </div>
                            </div>
                        </div>
                    </div>
                    <div class="modal-footer">
                        <button type="button" class="btn btn-primary qdBtn" >确定</button>
                        <button type="button" class="btn btn-default" data-dismiss="modal">返回</button>
                    </div>
                </div>
            </form>
        </div>
    </div>
    <!--回款历史编辑弹窗-->
    <div class="modal" id="registPayEditModal">
        <div class="modal-dialog" role="dialog">
            <form id="registPayEditForm">
                <div class="modal-content">
                    <div class="modal-header">
                        <button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">&times;</span></button>
                        <h4 class="modal-title"><strong>回款历史修改</strong></h4>
                    </div>
                    <div class="modal-body">
                        <input type="hidden" name="id" id="id" />
                        <div class="form-horizontal">
                            <div class="form-group">
                            	<label class="col-md-2 control-label">总回款凭据</label>
                                <div class="col-md-4">
                                	<div class="col-md-8">
										<input type="hidden" id="sReceivedPaymentTotalId1" /> 
										<input type="text" class="form-control"
											id="sReceivedPaymentTotalId-identify1" readonly="readonly" />
									</div>
									<div class="col-md-2">
										<button type="button" id="getsReceivedPaymentTotalId1" class="btn btn-info" title="引入回款凭据信息"> <i class="fa fa-search"></i> </button>
                                        <!-- <button type="button" id="getsReceivedPaymentTotalId1" class="btn btn-info">选择</button> -->
									</div>
									<div class="col-md-1">
										<button type="button" id="clearsReceivedPaymentTotalId1" class="btn btn-info">清除</button>
									</div>
								</div>
                                <label class="col-md-2 control-label">回款金额(元)</label>
                                <div class="col-md-4">
                                    <div class="col-md-10">
                                            <input class="form-control" type="text" name="nReceivedPaymentActualPrice1" id="nReceivedPaymentActualPrice1" datatype="*,*1-11,t" nullmsg="请输入回款金额" onkeyup="clearNoNum(this)"/>
                                    </div>
                                    <div class="col-md-1">
                                        <span style="color:#F00">*</span>
                                    </div>
                                </div>
                                
                            </div>
                            <div class="form-group">
                            	<label class="col-md-2 control-label">回款方式</label>
                                <div class="col-md-4">
                                    <div class="col-md-10">
                                        <select class="form-control" style="width: 100%"  type="text" name="sReceivedPaymentTradeWay1" id="sReceivedPaymentTradeWay1" datatype="*,*1-100,t" nullmsg="请输入回款方式">
                                            <option th:each="state:${states}"
                                                    th:text="${state.title}"
                                                    th:value="${state.id}">
                                            </option>
                                        </select>
                                    </div>
                                    <div class="col-md-1">
                                        <span style="color:#F00">*</span>
                                    </div>
                                </div>
                                <label class="col-md-2 control-label">回款人</label>
                                <div class="col-md-4">
                                    <div class="col-md-10">
                                        <select class="form-control" style="width: 100%" type="text"  name="sReceivedPaymentPersonId1" id="sReceivedPaymentPersonId1" datatype="*,*1-100,t" nullmsg="请输入回款人" >
                                            <option></option>
                                            <option th:each="user:${users}"
                                                    th:text="${user.empLogin.name}"
                                                    th:value="${user.empLogin.empId}">
                                            </option>
                                        </select>
                                    </div>
                                    <div class="col-md-1">
                                        <span style="color:#F00">*</span>
                                    </div>
                                </div>
                            </div>
                            <div class="form-group">
                            	<label class="col-md-2 control-label">回款时间</label>
                                <div class="col-md-4">
                                    <div class="col-md-10">
                                    <input class="form-control" type="date" name="dReceivedPaymentPlanAccDate1" id="dReceivedPaymentPlanAccDate1" datatype="*" nullmsg="请输入回款时间" />
                                    </div>
                                    <div class="col-md-1">
                                        <span style="color:#F00">*</span>
                                    </div>
                                </div>
                            	<label class="col-md-2 control-label">回款生效时间</label>
                                <div class="col-md-4">
                                    <div class="col-md-10">
                                    <input class="form-control" type="date" name="dReceivedPaymentActualAccDate1" id="dReceivedPaymentActualAccDate1" datatype="*" nullmsg="请输入回款时间" />
                                    </div>
                                    <div class="col-md-1">
                                        <span style="color:#F00">*</span>
                                    </div>
                                </div>
                            </div>
                            <div class="form-group" id = "handlerIsAssess">
                                <label class="col-md-2 control-label">经办人</label>
                                <div class="col-md-4">
                                    <div class="col-md-10">
                                    	<input class="form-control" type="text" name="sCreateUserId-text1" id="sCreateUserId-text1" th:value="${user.empLogin.name}" readonly="readonly"/>
                                    </div>
                                </div>
                            </div>
                            <div class="form-group">
                                <label class="col-md-2 control-label">备注</label>
                                <div class="col-md-8">
                                    <textarea class="form-control" style="width:100%" name="sReceivedPaymentMemo1" id="sReceivedPaymentMemo1" row="2"></textarea>
                                </div>
                            </div>
                        </div>
                    </div>
                    <div class="modal-footer">
                        <button type="button" class="btn btn-primary savePayBtn1" >保存</button>
                        <button type="button" class="btn btn-default" data-dismiss="modal">返回</button>
                    </div>
                </div>
            </form>
        </div>
    </div>
    <!--开票历史编辑弹窗-->
    <div class="modal" id="registPaymentEditModal">
        <div class="modal-dialog" role="dialog">
            <form id="registPaymentEditForm">
                <div class="modal-content">
                    <div class="modal-header">
                        <button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">&times;</span></button>
                        <h4 class="modal-title"><strong>开票历史修改</strong></h4>
                    </div>
                    <div class="modal-body">
                        <input type="hidden" name="id1" id="id1" />
                        <div class="form-horizontal">
                            <div class="form-group">
                                <label class="col-md-2 control-label">开票金额(元)</label>
                                <div class="col-md-4">
                                    <div class="col-md-10">
                                            <input class="form-control" type="text" name="paymentSum1" id="paymentSum1" datatype="*,*1-11,t" nullmsg="请输入开票金额" onkeyup="clearNoNum(this)"/>
                                    </div>
                                    <div class="col-md-1">
                                        <span style="color:#F00">*</span>
                                    </div>
                                </div>
                                <label class="col-md-2 control-label">开票人</label>
                                <div class="col-md-4">
                                    <div class="col-md-10">
                                        <select class="form-control" style="width: 100%" type="text"  name="paymentMan1" id="paymentMan1" datatype="*,*1-100,t" nullmsg="请输入开票人">
                                            <option></option>
                                            <option th:each="user:${users}"
                                                    th:text="${user.empLogin.name}"
                                                    th:value="${user.empLogin.name}">
                                            </option>
                                        </select>
                                    </div>
                                    <div class="col-md-1">
                                        <span style="color:#F00">*</span>
                                    </div>
                                </div>
                            </div>
                            <div class="form-group">
                                <label class="col-md-2 control-label">开票时间</label>
                                <div class="col-md-4">
                                    <div class="col-md-10">
                                    <input class="form-control" type="date" name="paymentDate1" id="paymentDate1" datatype="*" nullmsg="请输入开票时间"/>
                                    </div>
                                    <div class="col-md-1">
                                        <span style="color:#F00">*</span>
                                    </div>
                                </div>
                            </div>
                            <div class="form-group">
                                <label class="col-md-2 control-label">备注</label>
                                <div class="col-md-8">
                                    <div class="col-md-10">
                                    <textarea class="form-control" style="width:100%" name="memo2" id="memo2" row="2"></textarea>
                                    </div>
                                </div>
                            </div>
                        </div>
                    </div>
                    <div class="modal-footer">
                        <button type="button" class="btn btn-primary savePaymentBtn1" >保存</button>
                        <button type="button" class="btn btn-default" data-dismiss="modal">返回</button>
                    </div>
                </div>
            </form>
        </div>
    </div>
    <div class="modal  " id="ReceivedPaymentTotalModel">
			<div class="modal-dialog" role="dialog" style="width: 80%">
				<form id="ReceivedPaymentTotalform">
					<div class="modal-content">
						<div class="modal-header">
							<button type="button" class="close" data-dismiss="modal"
								aria-label="Close">
								<span aria-hidden="true">&times;</span>
							</button>
							<h4 class="modal-title">
								<strong>回款凭据选择</strong>
							</h4>
						</div>
						<div class="modal-body">
							<div class="form-horizontal">
								<div class="box-body">
									<div class="form-inline">
										<div class="input-group">
											<input type="text" class="form-control" id="searchReceived"
												   placeholder="Search..." /> <span class="input-group-btn">
													<button type="button" id="btn-search-rec"
															class="btn btn-info app-btn-search">查询</button>
													<button type="button" id="btn-reset-rec"
															class="btn btn-info app-btn-reset">撤消</button>
												</span>
										</div>
									</div>
								</div>
								<div class="box box-body">
									<table id="ReceivedPaymentTotalTable" class="mytable dataTable table-bordered text-center table-striped table-hover" cellspacing="0" width="100%" align="center">
										<thead>
											<tr>
												<th width="4%">序号</th>
                                				<th width="2%"><input type="radio" /></th>
												<th width="8%">凭证种类</th>
				                                 <th width="10%">凭证号</th>
				                                 <th width="10%">对方户名</th>
				                                 <th width="8%">户名</th>
				                                 <th width="8%">日期</th>
				                                 <th width="6%">交易类型</th>
				                                 <th width="6%">总回款金额</th>
				                                 <th width="6%">剩余回款金额</th>
				                                 <th width="6%">回款人</th>
				                                 <th width="6%">摘要</th>
				                                 <th width="6%">交易方式</th>
											</tr>
										</thead>
										<tbody>
										</tbody>
									</table>
								</div>
							</div>
						</div>
						<div class="modal-footer">
							<button type="button" class="btn btn-primary getReceived1">确定</button>
							<button type="button" class="btn btn-default"
								data-dismiss="modal">返回</button>
						</div>
					</div>
				</form>
			</div>
		</div>
		<div class="modal  " id="ReceivedPaymentTotalModel1">
			<div class="modal-dialog" role="dialog" style="width: 80%">
				<form id="ReceivedPaymentTotalform1">
					<div class="modal-content">
						<div class="modal-header">
							<button type="button" class="close" data-dismiss="modal"
								aria-label="Close">
								<span aria-hidden="true">&times;</span>
							</button>
							<h4 class="modal-title">
								<strong>回款凭据选择</strong>
							</h4>
						</div>
						<div class="modal-body">
							<div class="form-horizontal">
								<div class="box-body">
									<div class="form-inline">
										<div class="input-group">
											<input type="text" class="form-control" id="searchReceived1"
												   placeholder="Search..." /> <span class="input-group-btn">
													<button type="button" id="btn-search-rec1"
															class="btn btn-info app-btn-search">查询</button>
													<button type="button" id="btn-reset-rec1"
															class="btn btn-info app-btn-reset">撤消</button>
												</span>
										</div>
									</div>
								</div>
								<div class="box box-body">
									<table id="ReceivedPaymentTotalTable1" class="mytable dataTable table-bordered text-center table-striped table-hover" cellspacing="0" width="100%" align="center">
										<thead>
											<tr>
												<th width="4%">序号</th>
                                				<th width="2%"><input type="radio" /></th>
												<th width="8%">凭证种类</th>
				                                 <th width="10%">凭证号</th>
				                                 <th width="10%">对方户名</th>
				                                 <th width="8%">户名</th>
				                                 <th width="8%">日期</th>
				                                 <th width="6%">交易类型</th>
				                                 <th width="6%">总回款金额</th>
				                                 <th width="6%">剩余回款金额</th>
				                                 <th width="6%">回款人</th>
				                                 <th width="6%">摘要</th>
				                                 <th width="6%">交易方式</th>
											</tr>
										</thead>
										<tbody>
										</tbody>
									</table>
								</div>
							</div>
						</div>
						<div class="modal-footer">
							<button type="button" class="btn btn-primary getReceived2">确定</button>
							<button type="button" class="btn btn-default"
								data-dismiss="modal">返回</button>
						</div>
					</div>
				</form>
			</div>
		</div>
    <script th:src="@{/payment/registPay.js}"></script>
    <script>
        $(function () {
            $('#myTabs a[href="#tab_2"]').tab('show');
            $('.editPayBtn').show();
            $('.deletePayBtn').show();
            $('.deletePaymentBtn').hide();
            $('.editPaymentBtn').hide();
            $('#myTabs a[href="#tab_2"]').click(function (e) {
                e.preventDefault();
                $('.editPayBtn').show();
                $('.deletePayBtn').show();
                $('.editPaymentBtn').hide();
                $('.deletePaymentBtn').hide();
            });
            $('#myTabs a[href="#tab_3"]').click(function (e) {
                e.preventDefault();
                $('.editPaymentBtn').show();
                $('.deletePaymentBtn').show();
                $('.editPayBtn').hide();
                $('.deletePayBtn').hide();
            });
            $('#myTabs a[href="#tab_1"]').click(function (e) {
                e.preventDefault();
                $('.editPaymentBtn').hide();
                $('.deletePaymentBtn').hide();
                $('.editPayBtn').hide();
                $('.deletePayBtn').hide();
            })
            $('#myTabs a[href="#tab_4"]').click(function (e) {
                e.preventDefault();
                $('.editPaymentBtn').hide();
                $('.deletePaymentBtn').hide();
                $('.editPayBtn').hide();
                $('.deletePayBtn').hide();
            });
            $('#myTabs a[href="#tab_5"]').click(function (e) {
                e.preventDefault();
                $('.editPaymentBtn').hide();
                $('.deletePaymentBtn').hide();
                $('.editPayBtn').hide();
                $('.deletePayBtn').hide();
            });
            $('#myTabs a[href="#tab_"]').click(function (e) {
                e.preventDefault();
                $('.editPaymentBtn').hide();
                $('.deletePaymentBtn').hide();
                $('.editPayBtn').hide();
                $('.deletePayBtn').hide();
            })
        });
        jQuery(function() {
            if (jQuery("#giveOutDate").val() != '') {
                var sendDate = jQuery("#giveOutDate").val();
                jQuery("#giveOutDate1").val(
                        moment(sendDate).format('YYYY-MM-DD'));
            }
            if (jQuery("#signedDate").val() != '') {
                var sendDate = jQuery("#signedDate").val();
                jQuery("#signedDate1").val(
                        moment(sendDate).format('YYYY-MM-DD'));
            }
        });
    </script>
</div>
</body>
</html>